package com.luxx.service;

import com.spring.BeanPostProcessor;
import com.spring.Component;

@Component
public class LuxxBeanPostProcessor implements BeanPostProcessor{

    @Override
    public Object postProcessBeforeInitlization(Object bean, String beanName) {
        System.out.println("初始化前");
        if(beanName.equals("userService")){
            ((UserService)bean).setName("飒飒的");
        }
        return bean;
    }

    @Override
    public Object postProcessAfterInitlization(Object bean, String beanName) {
        System.out.println("初始化后");
        return bean;
    }
}
